package com.jiepu.homework.module5.exercise1;

public class Teacher { // 教师类
	
	private String name;		//姓名
	private int age;			//年龄
	private double salary;		//薪水
	
	public Teacher() {}
	public Teacher(String name, int age, double salary) {
		this.name = name;
		this.age = age;
		this.salary = salary;
	}
	
	// 用于年龄增加的方法
	public void increaseAge(){
		age++;
	}
	
	// get()方法相当于取东西：空着手去、带着东西回来
	public String getName() {
		return name;
	}
	// set()方法相当于送东西：带着东西去、空着手回来
	public void setName(String name) {
		this.name = name;
	}
	
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	
	public double getSalary() {
		return salary;
	}
	public void setSalary(double salary) {
		this.salary = salary;
	}
	
	// 打印输出属性的方法
	@Override
	public String toString() {
		return "name:"+name+"age:"+age+"salary:"+salary;
	}
	
	
	

}
